<nz-skeleton [nzLoading]="loading" [nzActive]="true">
    <div class="table-nzbordered">
        <nz-table #rowSelectionTable nzBordered [nzScroll]="lockHeadScroll" [nzLoadingDelay]="1000"
            [nzShowPagination]="false" [nzFrontPagination]="false" [nzPageSize]="selectedValue" [nzData]="bodyData"
            (nzCurrentPageDataChange)="currentPageDataChange($event)" (nzPageIndexChange)="refreshStatus()"
            (nzPageSizeChange)="refreshStatus()">
            <thead>
                <tr>
                    <th nzAlign="center" nzWidth="50px" nzShowCheckbox [(nzChecked)]="allChecked"
                        [nzIndeterminate]="indeterminate" (nzCheckedChange)="checkAll($event)"></th>
                    <th nzAlign="center" *ngFor="let item of headData" [nzWidth]="item.width">{{item.name}}</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of rowSelectionTable.data">
                    <td class="tight" nzAlign="center" nzShowCheckbox [(nzChecked)]="data.checked"
                        (nzCheckedChange)="refreshStatus()"></td>
                    <td class="tight" nzAlign="center">{{data.number}}</td>
                    <td class="tight" nzAlign="center">
                        <nz-date-picker (ngModelChange)="updateData(data,'analysisDate')"
                            [(ngModel)]="data.analysisDate"></nz-date-picker>
                    </td>

                    <td class="tight"
                        *ngIf="pageType === 'safetyAnalyse' || pageType === 'rotaryAnalyse' || pageType === 'eoasAnalyse' || pageType === 'videoAnalyse'"
                        nzAlign="center">
                        <input placeholder="请输入线别" (blur)="updateData(data,'line')" nzAlign="center" nz-input
                            [(ngModel)]="data.line" />
                    </td>

                    <td class="tight"
                        *ngIf="pageType === 'dmsAnalyse' || pageType === 'lkjAnalyse' || pageType === 'eoasAnalyse'"
                        nzAlign="center">
                        <textarea nz-input placeholder="请输入车次" (blur)="updateData(data,'trainNo')"
                            [(ngModel)]="data.trainNo" [nzAutosize]="{ minRows: 1, maxRows: 10 }"></textarea>
                    </td>

                    <td class="tight" *ngIf="pageType === 'dmsAnalyse' || pageType === 'lkjAnalyse'" nzAlign="center">
                        <textarea nz-input placeholder="请输入车号" (blur)="updateData(data,'trainNum')"
                            [(ngModel)]="data.trainNum" [nzAutosize]="{ minRows: 1, maxRows: 10 }"></textarea>
                    </td>

                    <td class="tight"
                        *ngIf="pageType === 'safetyAnalyse' || pageType === 'rotaryAnalyse' || pageType === 'videoAnalyse'"
                        nzAlign="center">
                        <input placeholder="请输入车站" (blur)="updateData(data,'startStation')" class="wd150 center"
                            nz-input [(ngModel)]="data.startStation" />
                        -
                        <input placeholder="请输入车站" (blur)="updateData(data,'endStation')" class="wd150 center" nz-input
                            [(ngModel)]="data.endStation" />
                    </td>

                    <td class="tight" nzAlign="center">
                        <nz-time-picker nzPlaceHolder="请选择" (ngModelChange)="updateData(data,'startTime')"
                            [(ngModel)]="data.startTime" nzFormat="HH:mm"></nz-time-picker>
                        -
                        <nz-time-picker nzPlaceHolder="请选择" (ngModelChange)="updateData(data,'endTime')"
                            [(ngModel)]="data.endTime" nzFormat="HH:mm"></nz-time-picker>
                    </td>
                    <td class="tight" nzAlign="center">
                        <input placeholder="请输入分析人" (blur)="updateData(data,'analysisUser')" nzAlign="center" nz-input
                            [(ngModel)]="data.analysisUser" />
                    </td>
                    <td class="tight" nzAlign="center">
                        <div nz-row>
                            <div nz-col nzSpan="5">
                                <span class="round"
                                    [ngStyle]="{'background':data.finished === '0' ? '#ff4f4f':'#33db7d'}"></span>
                            </div>
                            <div nz-col nzSpan="19">
                                <nz-select class="wd" [(ngModel)]="data.finished"
                                    (ngModelChange)="updateData(data,'finished')">
                                    <nz-option *ngFor="let item of wcztSelect" [nzValue]="item.value"
                                        [nzLabel]="item.label"></nz-option>
                                </nz-select>
                            </div>
                        </div>
                    </td>
                    <td class="tight" nzAlign="center">
                        <textarea nz-input placeholder="请输入备注" (blur)="updateData(data,'remark')"
                            [(ngModel)]="data.remark" [nzAutosize]="{ minRows: 1, maxRows: 10 }"></textarea>
                    </td>
                </tr>
            </tbody>
        </nz-table>
    </div>
</nz-skeleton>
<div class="pageWrap">
    <div class="pageSelect">
        每页
        <nz-select class="wd70" [(ngModel)]="selectedValue" (ngModelChange)="selectedChange()">
            <nz-option nzValue="20" nzLabel="20"></nz-option>
            <nz-option nzValue="50" nzLabel="50"></nz-option>
            <nz-option nzValue="100" nzLabel="100"></nz-option>
            <nz-option nzValue="200" nzLabel="200"></nz-option>
        </nz-select> 条&nbsp;&nbsp;&nbsp;总共<span class="pageTotal">{{pageTotal}}</span>条
    </div>
    <div class="pageInation">
        <nz-pagination [nzPageSize]="selectedValue" [nzPageIndex]="pageValue" [nzTotal]="rowTotalTable"
            (nzPageIndexChange)="rowChangeTable($event)"></nz-pagination>
    </div>
</div>